package com.bawei.module_main.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.bawei.module_advice.ui.AdviceFragment

import com.bawei.module_home.ui.HomeFragment
import com.bawei.module_message.ui.MessageFragment
import com.bawei.module_mine.MineFragment
import com.bawei.module_service.ui.ServiceFragment
/**
 *author：yjk
 *description:
 *date：2025/6/11
*/
class ViewPageAdapter(fragmentActivity :FragmentActivity): FragmentStateAdapter(fragmentActivity) {


    override fun getItemCount(): Int {
        return 5
    }

    override fun createFragment(position: Int): Fragment {
        return when (position) {
            0 -> HomeFragment()
            1 -> ServiceFragment()
            2 -> MessageFragment()
            3 -> AdviceFragment()
            4 -> MineFragment()
            else -> HomeFragment()
        }
    }
}